<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:82:"D:\www\photo_album_bless\public_html/../application/wxapplet\view\manager\add.html";i:1544144729;s:69:"D:\www\photo_album_bless\application\wxapplet\view\shared\layout.html";i:1544144729;}*/ ?>
<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:16:41 GMT -->
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <title>新增小程序</title>

    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->

    <link rel="stylesheet" href="/static/plugins/bootstrap-3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="/static/plugins/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="/static/sys/css/style.min.css">
    <link rel="stylesheet" href="/static/plugins/bootstrap-table/bootstrap-table.css">
    <link rel="stylesheet" href="/static/plugins/dataTables/dataTables.bootstrap.css">
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css">
    
    <script src="/static/plugins/jquery-1.12.4/jquery-1.12.4.min.js"></script>
    <script src="/static/plugins/bootstrap-3.3.7/js/bootstrap.min.js"></script>
    <script src="/static/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="/static/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="/static/plugins/layui/layui.js"></script>
    <style>
        .text-red{color:red;}
        .text-green{color:#17bb46;}
        .text-orange{color:orange;}
        .text-yellow{color:#c7cd2f;}
        .text-blue{color:#0bb8c8;}
        .fixed-table-toolbar .bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search{margin-top:-45px;}
        .th-inner{color:#555;}
    </style>
    
    <link href="/static/sys/css/skin_0.css" rel="stylesheet" />    

</head>

<body class="gray-bg">
    
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <form method="post" id="fmNew" class="form-horizontal">                            
                            <div class="form-group">
                                <label class="col-sm-2 control-label">小程序名称：</label>
                                <div class="col-sm-4">
                                    <input type="text" id="txtname" name="name" class="form-control" placeholder="请输入小程序名称">
                                </div>                                                                
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">小程序OriginalId</label>
                                <div class="col-sm-4">
                                    <input type="text" name="original_id" id="txtoriginal_id" class="form-control" placeholder="请输入小程序OriginalId">
                                </div>                                
                            </div>                            
                            <div class="form-group">                                
                                <label class="col-sm-2 control-label">跳转小程序：</label>
                                <div class="col-sm-1 onoff" style="padding-top:4px;">
                                    <label for="isjump1" class="cb-enable"><span>是</span></label>
                                    <label for="isjump0" class="cb-disable selected"><span>否</span></label>
                                    <input id="isjump1" name="isjump" value="1" type="radio">
                                    <input id="isjump0" name="isjump" value="0" checked="checked" type="radio">
                                </div>
                                <label class="col-sm-2 control-label">跳转目标AppId</label>
                                <div class="col-sm-4">
                                    <input type="text" name="app_id" id="txtapp_id" class="form-control" placeholder="请输入目标小程序AppId">
                                </div> 
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">跳转地址</label>
                                <div class="col-sm-4">
                                    <input type="text" name="jump_url" id="txtjump_url" class="form-control" placeholder="请输入跳转目标小程序地址">
                                </div>                                
                            </div> 
                            <div class="form-group">                                
                                <label class="col-sm-2 control-label">显示审核壳：</label>
                                <div class="col-sm-1 onoff" style="padding-top:4px;">
                                    <label for="isshow1" class="cb-enable"><span>是</span></label>
                                    <label for="isshow0" class="cb-disable selected"><span>否</span></label>
                                    <input id="isshow1" name="isshow" value="1" type="radio">
                                    <input id="isshow0" name="isshow" value="0" checked="checked" type="radio">
                                </div>
                                <label class="col-sm-2 control-label">显示审核壳(备用)：</label>
                                <div class="col-sm-4 onoff" style="padding-top:4px;">
                                    <label for="isshowback1" class="cb-enable"><span>是</span></label>
                                    <label for="isshowback0" class="cb-disable selected"><span>否</span></label>
                                    <input id="isshowback1" name="isshowback" value="1" type="radio">
                                    <input id="isshowback0" name="isshowback" value="0" checked="checked" type="radio">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-12 col-sm-offset-5">
                                    <button class="btn btn-primary" id="ok" type="button">提交</button>
                                    <button class="btn btn-white" id="cancel" type="button">取消</button>
                                </div>
                            </div>
                        </div>                        
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>        

</body>
        
    <script type="text/javascript">
        $(document).ready(function () {
            $("#ok").bind("click", Save);
            $("#cancel").bind("click", function () {
                parent.layer.close(parent.layer_add_index);
            });
            $(".cb-enable").click(function () {
                var parent = $(this).parents('.onoff');
                $('.cb-disable', parent).removeClass('selected');
                $(this).addClass('selected');
                $('.checkbox', parent).attr('checked', true);
            });
            $(".cb-disable").click(function () {
                var parent = $(this).parents('.onoff');
                $('.cb-enable', parent).removeClass('selected');
                $(this).addClass('selected');
                $('.checkbox', parent).attr('checked', false);
            });            
        })
       
        function Save() {
            layui.use(['layer'], function(){
                var layer = layui.layer;

                var name = $.trim($("input[name=name]").val());
                if (name.length == 0) {
                    layer.tips('微信小程序名称不能为空！', 'input[name=name]', { tips: [2, '#78BA32'] });
                    return false;
                }
                var original_id = $.trim($("input[name=original_id]").val());
                if (original_id.length == 0) {
                    layer.tips('微信小程序original_id不能为空！', 'input[name=original_id]', { tips: [2, '#78BA32'] });
                    return false;
                }
                
                

                var load_index = layer.load(0, { shade: false });
                $.ajax({
                    type: "post",
                    url: "<?php echo url('manager/add'); ?>?t=" + new Date(),
                    data: $("form").serialize(),
                    dataType: "json",
                    success: function (result) {
                        layer.close(load_index);
                        if (result.code == 0) {
                            layer.alert('保存成功！', function () {
                                if (typeof (parent.initTable) == "function")
                                    parent.initTable();
                                parent.layer.close(parent.layer_add_index)
                            });
                        } else {
                            layer.alert(result.msg);
                        }
                    }
                });
            });
        }
    </script>

<!-- Mirrored from www.zi-han.net/theme/hplus/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:17:11 GMT -->
</html>